<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>

    <script type="text/javascript" src="../lib/jquery.js"></script>
    <script type="text/javascript">
        function rollBack(fn) {
            $.get('http://www.liulongbin.top:3006/api/getbooks', function(res) {
                var book = res.data;
                fn(book);
            })
        }
        rollBack(function(data) {
                console.log(data);
            })
            //高阶函数，他的参数是函数或者返回一个函数
    </script>
</body>

</html>